<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    <link href="${resources}/plugins/fontAwesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="${resources}/plugins/swiper/3.3.1/swiper.min.css" rel="stylesheet" type="text/css">
    <link href="${resources}/css/sm.min.css" rel="stylesheet" type="text/css">
    <link href="${resources}/css/common.css" rel="stylesheet" type="text/css">
    <link href="${resources}/css/addaddress.css" rel="stylesheet" type="text/css">
</head>
<body>
<div id="container">
    <!--头部-->
    <div class="commonHeader">我的地址
        <a href="javascript:history.go(-1);" class="fa fa-chevron-left back"></a>
    </div>
	
	<form action="${path}/manage/address/update/${address.id}?prevurl=${prevurl}"  method="post" id="addressForm">
	<input type="hidden" name="id" value="${address.id}"/>
    <table class="list">
        <tr>
            <td><label for="name">收货人</label></td>
            <td><input type="text" id="name" name="name" placeholder="请输入收货人姓名" value="${address.name}"></td>
        </tr>
        <tr>
            <td><label for="phone">联系电话</label></td>
            <td><input type="text" id="telephone" name="telephone" placeholder="请输入收货人联系电话" value="${address.telephone}"></td>
        </tr>
        <tr>
            <td><label for="phone">所在地区</label></td>
            <td><input type="text" id="address" name="address" placeholder="请选择" value="${address.address}"/></td>
        </tr>
        <tr>
            <td><label for="phone">是否默认</label></td>
            <td>
            	是<input name="isDefault" id="isDefault" type="radio" value="1" ${(address.isDefault==1)?string('checked','')} >
            	否<input name="isDefault" id="isDefault" type="radio" value="0" ${(address.isDefault==0)?string('checked','')}>
            </td>
        </tr>
        <tr>
            <td colspan="2"><textarea  name="street" placeholder="请填写详细地址，不少于5个字">${address.street}</textarea></td>
        </tr>
    </table>

    <div class="bottomBtn">
        <a href="javascript:submitForm();">保存地址</a>
    </div>
	</form>
</div>

<script src="${resources}/js/zepto.min.js"></script>
<script src="${resources}/js/sm.min.js"></script>
<script src="${resources}/js/sm-city-picker.min.js"></script>
<script>
    $("#address").cityPicker({
        toolbarTemplate: '<header class="bar bar-nav">\
    <button class="button button-link pull-right close-picker">确定</button>\
    <h1 class="title">选择收货地址</h1>\
    </header>'
    });
    
    function submitForm(){
    	$("#addressForm").submit();
    }
</script>
</body>
</html>